﻿<%@ Import Namespace="TTQT.TTQT_Code" %>
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="DMHangHoa.ascx.cs" Inherits="DMHangHoa" %>
<center>
    <asp:Panel ID="pnGroupGrid" runat="server" Width="500px">
        <asp:DataGrid Width="100%" ID="datagrid" runat="server" AutoGenerateColumns="False"
            PageSize="20" OnItemCommand="datagrid_ItemCommand" OnItemDataBound="datagrid_ItemDataBound"
            AllowPaging="True" OnPageIndexChanged="datagrid_PageIndexChanged">
            <PagerStyle Mode="NumericPages"></PagerStyle>
            <AlternatingItemStyle CssClass="DarkRow"></AlternatingItemStyle>
            <ItemStyle CssClass="LightRow"></ItemStyle>
            <HeaderStyle Font-Bold="True" CssClass="HeaderRow"></HeaderStyle>
            <Columns>
                <asp:BoundColumn DataField="ID" HeaderText="ID" Visible="false">
                    <ItemStyle HorizontalAlign="Left" />
                </asp:BoundColumn>
                <asp:BoundColumn DataField="MaHang" HeaderText="Mã hàng">
                    <HeaderStyle CssClass="HeaderRow"></HeaderStyle>
                </asp:BoundColumn>
                <asp:BoundColumn DataField="TenHang" HeaderText="Tên hàng">
                    <ItemStyle HorizontalAlign="Left" />
                </asp:BoundColumn>
                <asp:BoundColumn DataField="DonViTinh" HeaderText="Đơn vị">
                    <ItemStyle HorizontalAlign="Left" />
                </asp:BoundColumn>
                <asp:TemplateColumn HeaderText="Giá bán">
                    <HeaderStyle HorizontalAlign="Center" CssClass="HeaderRow"></HeaderStyle>
                    <ItemStyle HorizontalAlign="Right"></ItemStyle>
                    <ItemTemplate>
                        <%# TTQTCommon.formatTien_KhongThapPhan(DataBinder.Eval(Container.DataItem, "GiaBan").ToString())%>
                    </ItemTemplate>
                </asp:TemplateColumn>
                <asp:BoundColumn DataField="KhuyenMai" HeaderText="Khuyến mại">
                    <ItemStyle HorizontalAlign="Left" />
                </asp:BoundColumn>
                <asp:BoundColumn DataField="Active" HeaderText="Trạng thái">
                    <ItemStyle HorizontalAlign="Left" />
                </asp:BoundColumn>
                <asp:TemplateColumn>
                    <ItemStyle HorizontalAlign="Center"></ItemStyle>
                    <ItemTemplate>
                        <asp:Button CausesValidation="False" ID="cmdEdit" runat="server" Text="Sửa" Width="40"
                            CommandName="cmdEdit"></asp:Button>
                    </ItemTemplate>
                </asp:TemplateColumn>
                <asp:TemplateColumn>
                    <ItemStyle HorizontalAlign="Center"></ItemStyle>
                    <ItemTemplate>
                        <asp:Button CausesValidation="False" ID="cmdDelete" runat="server" Text="Xóa" Width="40"
                            CommandName="cmdDelete"></asp:Button>
                    </ItemTemplate>
                </asp:TemplateColumn>
            </Columns>
        </asp:DataGrid>
        <asp:SqlDataSource ID="ds" runat="server" ConnectionString="<%$ ConnectionStrings:DBConnectionString %>"
            ProviderName="<%$ ConnectionStrings:DBConnectionString.ProviderName %>"></asp:SqlDataSource>
        <asp:Button ID="cmdAddNew" runat="server" Text="Thêm mới" OnClick="cmdAddNew_Click">
        </asp:Button>
    </asp:Panel>
    <asp:Panel ID="pnEdit" runat="server" Width="700px">
        <table class="Area" style="border-right: gray 1px solid; border-top: gray 1px solid;
            border-left: gray 1px solid; border-bottom: gray 1px solid" cellspacing="5" cellpadding="0"
            width="100%" border="0">
            <tr>
                <td style="color: blue" align="center" colspan="3">
                    <asp:Label ID="Label1" runat="server"></asp:Label>
                </td>
            </tr>
            <tr>
                <td width="10">
                </td>
                <td class="SubHead">
                    Mã hàng
                </td>
                <td>
                    <asp:TextBox ID="txtMaHang" Width="200px" runat="server" Enabled="False"></asp:TextBox>
                    <asp:TextBox ID="txtID" runat="server" Enabled="False" Width="200px" Visible="False"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td width="10">
                </td>
                <td class="SubHead">
                    Tên hàng
                </td>
                <td>
                    <asp:TextBox ID="txtTenHang" Width="200px" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td width="10">
                </td>
                <td class="SubHead">
                    Đơn vị tính
                </td>
                <td>
                    <asp:TextBox ID="txtDonVi" Width="200px" runat="server"></asp:TextBox>
                    &nbsp;(Chiếc/kg...)</td>
            </tr>
            <tr>
                <td width="10">
                </td>
                <td class="SubHead">
                    Tồn thấp
                </td>
                <td>
                    <asp:TextBox ID="txtTonThap" Width="200px" runat="server"></asp:TextBox>Nhập số
                    lượng
                </td>
            </tr>
            <tr>
                <td width="10">
                </td>
                <td class="SubHead">
                    Tồn cao
                </td>
                <td>
                    <asp:TextBox ID="txtTonCao" Width="200px" runat="server"></asp:TextBox>Nhập số lượng
                </td>
            </tr>
            <tr>
                <td width="10">
                </td>
                <td class="SubHead">
                    Giá bán (giá chưa bao gồm khuyến mại)
                </td>
                <td>
                    <asp:TextBox ID="txtGiaBan" Width="200px" runat="server"></asp:TextBox>&nbsp;VNĐ
                </td>
            </tr>
            <tr>
                <td width="10">
                </td>
                <td class="SubHead">
                    Khuyến mại
                </td>
                <td>
                    <asp:TextBox ID="txtKhuyenMai" Width="200px" runat="server"></asp:TextBox>% (Nhập
                    10 thì sẽ là 10%)
                </td>
            </tr>
            <tr>
                <td style="color: red; font-family: arial" align="center" colspan="3" height="10">
                    <asp:Label ID="lblError" runat="server"></asp:Label><asp:Label ID="lblUpdateStatus"
                        runat="server"></asp:Label>
                </td>
            </tr>
            <tr>
                <td align="center" colspan="3">
                    <asp:Button ID="cmdUpdate" Width="72px" Text="Cập nhật" runat="server" CausesValidation="true"
                        OnClick="cmdUpdate_Click"></asp:Button>
                    <asp:Button ID="cmdCancel" Width="72" Text="Quay lại" runat="server" CausesValidation="False"
                        OnClick="cmdCancel_Click"></asp:Button>
                </td>
            </tr>
        </table>
    </asp:Panel>
</center>
